<?php
// +----------------------------------------------------------------------
// | MyCentOS
// +----------------------------------------------------------------------
// | Copyright (c) 2014 http://www.mycentos.com, All rights reserved.
// +----------------------------------------------------------------------
// | Author: 琥珀 <317559272@qqq.com><http://www.mycentos.com>
// +----------------------------------------------------------------------
// | @date  : 2015-04-11 16:37:56
// +----------------------------------------------------------------------
// | @Last Modified by:  琥珀
// +----------------------------------------------------------------------
// | @Last Modified time: 2015-04-11 16:54:27
// +-----------------------------------------------------------------------

namespace Admin\Model;
use Think\Model;

class CategoryModel extends Model{

    protected $_validate =array(
        array('name','require','栏目名称不能为空'),
        array('ename','require','英文栏目名称不能为空'),

        );
    public function checkCategory($data){
        $model = M('Category');
        $d =$model->where(array('id'=>$data['pid']))->find();
        if ($d['pid']!==$data['id']) {
            return true;
        }else{
            return false;
        }

    }
}
?>